Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Base support to Uniswap widget #619

Merged
merged 10 commits into from
Sep 25, 2023
Merged

Conversation

abarthell
Copy link
Contributor

@abarthell abarthell commented Sep 14, 2023

Add Base support to Uniswap widget.

Tested swapping ETH to USDC on Base: https://basescan.org/tx/0xb230b5039555c3087b61906555b1b9495395cb60486b68f9871f791505429789

Screen Shot 2023-09-21 at 3 06 15 PM Screen Shot 2023-09-21 at 3 13 15 PM

@vercel
Copy link

vercel bot commented Sep 14, 2023

@abarthell is attempting to deploy a commit to the Uniswap Team on Vercel.

A member of the Team first needs to authorize it.

@abarthell abarthell force-pushed the add-base branch 2 times, most recently from 534f5f0 to eb61652 Compare September 14, 2023 07:55
@abarthell abarthell changed the title Add Base support to Uniswap widget feat: Add Base support to Uniswap widget Sep 14, 2023
@abarthell abarthell force-pushed the add-base branch 7 times, most recently from c2bfa5d to e16253b Compare September 14, 2023 08:59
@abarthell abarthell force-pushed the add-base branch 2 times, most recently from bf0710f to 7b1e5aa Compare September 14, 2023 09:36
@@ -237,6 +238,19 @@ const CHAIN_INFO: ChainInfoMap = {
color: '#F0B90B',
backgroundColor: '#F0B90B',
},
[SupportedChainId.BASE]: {
networkType: NetworkType.L2,
blockWaitMsBeforeWarning: ms`10m`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It maybe worth making this match optimism:

    blockWaitMsBeforeWarning: ms`25m`,

[SupportedChainId.BASE]: [
// "Safe" URLs
'https://mainnet.base.org',
'https://developer-access-mainnet.base.org/',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets remove developer-access-mainnet.base.org, it resolves to the same hosts as mainnet.base.org and at some point we may remove it.

@just-toby
Copy link
Collaborator

@abarthell assuming you were able to test locally, get quotes and execute trades - please mark this PR ready for review when you want us to review it !

@abarthell
Copy link
Contributor Author

abarthell commented Sep 21, 2023

@abarthell assuming you were able to test locally, get quotes and execute trades - please mark this PR ready for review when you want us to review it !

@just-toby I don't think this PR will work until USDC on Base is added here (instead of USDbC). Should I also make a change there first? I wasn't sure if it'd cause some issue with the existing pool to just swap the contract address

@just-toby
Copy link
Collaborator

just-toby commented Sep 21, 2023

@abarthell that's a token constant in our interface repo - it doesn't affect the widget. feel free to send us a PR to update it, but i don't think it's related to this PR.

@vercel
Copy link

vercel bot commented Sep 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
widgets ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 22, 2023 0:30am

@abarthell abarthell marked this pull request as ready for review September 22, 2023 00:04
@@ -67,7 +67,7 @@
"@uniswap/redux-multicall": "^1.1.8",
"@uniswap/router-sdk": "^1.6.0",
"@uniswap/sdk-core": "^4.0.6",
"@uniswap/smart-order-router": "^3.13.7",
"@uniswap/smart-order-router": "^3.16.25",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, i was about to comment but you found it 👍

@vercel vercel bot temporarily deployed to Preview September 22, 2023 00:19 Inactive
@@ -21,6 +21,8 @@ export enum SupportedChainId {
CELO_ALFAJORES = 44787,

BNB = 56,

BASE = 8453,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at some point our team might remove this enum entirely, like i started to do in #615 but for now this works

@just-toby
Copy link
Collaborator

@abarthell please run yarn deduplicate - i'm seeing the lints and tests passing locally, so i don't think we need to worry about those checks. probably just need to rerun or fix the github action

@abarthell
Copy link
Contributor Author

abarthell commented Sep 22, 2023

@abarthell please run yarn deduplicate - i'm seeing the lints and tests passing locally, so i don't think we need to worry about those checks. probably just need to rerun or fix the github action

@just-toby Sounds good! just ran deduplicate and also bumped the deps it was erroring on

@vercel vercel bot temporarily deployed to Preview September 22, 2023 00:30 Inactive
@just-toby
Copy link
Collaborator

just-toby commented Sep 22, 2023

the test suite is only failing in your fork because you don't have the JSON_RPC_PROVIDER env variable set. it's passing for me and it should pass on main once we merge

edit: i forgot the check is required. so we don't break protocol here, do you mind setting the env variable so we can re-run the tests and get all green ? :D

@abarthell
Copy link
Contributor Author

abarthell commented Sep 22, 2023

the test suite is only failing in your fork because you don't have the JSON_RPC_PROVIDER env variable set. it's passing for me and it should pass on main once we merge

edit: i forgot the check is required. so we don't break protocol here, do you mind setting the env variable so we can re-run the tests and get all green ?

@just-toby Ahh I see, good catch. I just set JSON_RPC_PROVIDER = https://mainnet.infura.io in the github fork env vars. can we try re-running it?

@just-toby
Copy link
Collaborator

hmm @abarthell i think i was wrong and it's our repo that has the wrong value for this variable. i'll get it updated and make sure your PR gets merged. (might be tomorrow since i don't have permissions to edit the settings in this repo)

@abarthell
Copy link
Contributor Author

@just-toby Can we try re-running it one more time? I think I had the wrong variable before actually

@just-toby just-toby merged commit 630c927 into Uniswap:main Sep 25, 2023
6 of 7 checks passed
@abarthell
Copy link
Contributor Author

@just-toby can you help upgrade the latest npm version of the widget as well? 😁

Also, here's two more PRs to add Base USDC on the interface (instead of USDbC) and the corresponding assets:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants